<html>
  <head>
    <link type="text/css" rel="stylesheet" href="/stylesheets/main.css" />
  </head>
  <body>
    {% if guestbook_name %}
      <title>{{guestbook_name}}'s Guestbook</title>
      <h1>{{guestbook_name}}'s guestbook </h1>

      {% for greeting in greetings %}
        {% if greeting.author %}
          {{greeting.date|datetimeformat}}: <b>{{greeting.author}}</b> wrote:
        {% else %}
	<!-- datetimeformat filter: It is possible to specify another format than the default -->
          {{greeting.date|datetimeformat("%m-%d-%Y @ %H:%M")}}: An anonymous person wrote:
        {% endif %}
        <blockquote>{{greeting.content|escape}}</blockquote>
      {% endfor %}

      <form action="/sign?{{ guestbook }}" method="post">
        <div><textarea name="content" rows="3" cols="60"></textarea></div>
        <div><input type="submit" value="Sign Guestbook"></div>
      </form>

      <hr>
      <form>Guestbook name: <input value="{{ value }}" name="guestbook_name">
        <input type="submit" value="switch">
      </form>
    {% else %}
      <hr>
      <form>Choose a guestbook: <input value="{{ value }}" name="guestbook_name">
        <input type="submit" value="switch">
      </form>
    {% endif %}

    <a href="{{ url }}">{{url_linktext}}</a>

  </body>
</html>